package test2;

import java.math.BigDecimal;

public class PhoneTest {
    public static void main(String[] args) {
        Phone[] phone=new Phone[3];
        Phone phone1=new Phone("vivo",2001,"white");
        Phone phone2=new Phone("小米",2500,"red");
        Phone phone3=new Phone("华为",5000,"black");
        phone[0]=phone1;
        phone[1]=phone2;
        phone[2]=phone3;
        System.out.println("三部手机的平均价格是"+(phone[0].getPrice()+phone[1].getPrice()+phone[2].getPrice())/3.0);
    }
}
